/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.student.tp3assignment2.ispviolate;

/**
 *
 * @author Student
 */
public class Emailer {
    String name;
    String emailAddress;
    String subject;
    String body;

    public void SetDetails(Contact contact, String subject, String body)
    {
        name = contact.GetName();
        emailAddress = contact.GetEmailAddress();
        this.subject = subject;
        this.body = body;
        // this class is aware of other members/attributes of the Contact class.
        // Example: telephone. Violates ISP
    }

    public String GetMessage()
    {
        return "incoming message#Name=\""+name+"\"#To=\""+emailAddress+"\"#Subject=\""+subject+"\"#Body=\""+body+"\"";
    }
}
